class Base{
    int a=100;
    int b=200;
}

class Derived extends Base{
    int a=101;
    int c=300;
    public void show(){
        System.out.println(a+ " " + b + " " + c);
        System.out.println(super.a + " " + b + " " + c);
        //需要访问父类中同名变量时用super.
    }
}

public class Main1 {
    public static void main(String[] args) {
        Derived d=new Derived();
        d.show();//在父子类继承中，有相同的变量时，优先访问子类自己的变量

    }
}
